package com.apps.config;

import com.apps.thirdparty.pay.alipay.config.KupaAlipayConfig;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@EnableAutoConfiguration
public class AliPayConfig {

    //支付宝支付配置参数
    @Value("${alipay.AppId}")
    private String Pc_AppId;
    @Value("${alipay.PrivateKey}")
    private String Pc_PrivateKey;
    @Value("${alipay.PublicKey}")
    private String Pc_PublicKey;
    @Value("${alipay.AliPubkey}")
    private String AliPubkey;
    @Value("${alipay.format}")
    private String Pc_format;
    @Value("${alipay.signType}")
    private String  Pc_signType;
    @Value("${alipay.ReturnUrl}")
    private String  Pc_ReturnUrl;
    @Value("${alipay.NotifyUrl")
    private String NotifyUrl;

    @Bean
    public KupaAlipayConfig getAlipayConfig()
    {
        KupaAlipayConfig alipayConfig=new KupaAlipayConfig();
        alipayConfig.setAppId(Pc_AppId);
        alipayConfig.setPrivateKey(Pc_PrivateKey);
        alipayConfig.setPublicKey(Pc_PublicKey);
        alipayConfig.setAlipayPubkey(AliPubkey);
        alipayConfig.setFormat(Pc_format);
        alipayConfig.setSignType(Pc_signType);
        alipayConfig.setReturnUrl(Pc_ReturnUrl);
        alipayConfig.setNotifyUrl(NotifyUrl);
        return alipayConfig;
    }

}
